home *** CD-ROM | disk | FTP | other *** search
/ Dr. Windows 3 / dr win3.zip / dr win3 / WINICONS / V12N11.ZIP / ABOUT.ZIP / DEMOPROG.PAS < prev    next >
Pascal/Delphi Source File  |  1993-03-31  |  1KB  |  54 lines

  1. {************************************************}
  2. {   About box demo program                       }
  3. {   Copyright (c) 1993 by Danny Thorpe           }
  4. {                                                }
  5. {   for Borland Pascal 7.0                       }
  6. {************************************************}
  7.  
  8. program Demo;
  9.  
  10. uses Winprocs, Wintypes, OWindows, BWCC, About;
  11.  
  12. {$R demo.res}
  13.  
  14. const
  15.   cmAbout = 101;
  16.   idBitmap = 200;
  17.  
  18.   CreditText: array[1..7] of PChar = (
  19.     '',
  20.     'This is where you would',
  21.     'put your own list of',
  22.     'names or secret message',
  23.     'to reward the users who',
  24.     'discover this.',
  25.     '');
  26.  
  27. type
  28.   PDemoMainWindow = ^TDemoMainWindow;
  29.   TDemoMainWindow = object(TMDIWindow)
  30.     procedure cmAbout(var Msg: TMessage); virtual cm_First + cmAbout;
  31.   end;
  32.  
  33.   TDemoApp = object(TApplication)
  34.     procedure InitMainWindow; virtual;
  35.   end;
  36.  
  37. procedure TDemoMainWindow.cmAbout(var Msg: TMessage);
  38. begin
  39.   Application^.ExecDialog(New(PAboutBox,
  40.      Init(@Self, 'Demo About Box',PChar(idBitmap), CreditText)));
  41. end;
  42.  
  43. procedure TDemoApp.InitMainWindow;
  44. begin
  45.   MainWindow := New(PDemoMainWindow, Init('Demo App',
  46.                          LoadMenu(HInstance,'MainMenu')));
  47. end;
  48.  
  49. var App: TDemoApp;
  50. begin
  51.   App.Init('Demo');
  52.   App.Run;
  53.   App.Done;
  54. end.